/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

/**
 *
 * @author William
 */
public class MainFrame extends javax.swing.JFrame {

    /**
     * Creates new form MainFrame
     */
    private CreateReagentPanel createReagentPanel;
    private EditReagentPanel editReagentPanel;
    private SearchReagentPanel searchReagentPanel;
    private DeleteReagentPanel deleteReagentPanel;

    public MainFrame() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        MainPanel = new javax.swing.JPanel();
        jMenuBar1 = new javax.swing.JMenuBar();
        fileM = new javax.swing.JMenu();
        startMI = new javax.swing.JMenuItem();
        exitMI = new javax.swing.JMenuItem();
        reagentM = new javax.swing.JMenu();
        createReagentMI = new javax.swing.JMenuItem();
        searchReagentMI = new javax.swing.JMenuItem();
        editReagentMI = new javax.swing.JMenuItem();
        deleteReagentMI = new javax.swing.JMenuItem();
        searchAllReagentMI = new javax.swing.JMenuItem();
        orderM = new javax.swing.JMenu();
        createOrderMI = new javax.swing.JMenuItem();
        searchOrderMI = new javax.swing.JMenuItem();
        editOrderMI = new javax.swing.JMenuItem();
        deleteOrderMI = new javax.swing.JMenuItem();
        searchAllOrderMI = new javax.swing.JMenuItem();
        aboutM = new javax.swing.JMenu();
        aboutMI = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(255, 255, 255));

        MainPanel.setBackground(new java.awt.Color(255, 255, 255));
        MainPanel.setPreferredSize(new java.awt.Dimension(640, 520));
        MainPanel.setLayout(new java.awt.BorderLayout());

        fileM.setText("Archivo");

        startMI.setText("Inicio");
        startMI.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                startMIActionPerformed(evt);
            }
        });
        fileM.add(startMI);

        exitMI.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_MASK));
        exitMI.setText("Salir");
        exitMI.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitMIActionPerformed(evt);
            }
        });
        fileM.add(exitMI);

        jMenuBar1.add(fileM);

        reagentM.setText("Reactivos");

        createReagentMI.setText("Crear");
        createReagentMI.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                createReagentMIActionPerformed(evt);
            }
        });
        reagentM.add(createReagentMI);

        searchReagentMI.setText("Buscar");
        searchReagentMI.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                searchReagentMIActionPerformed(evt);
            }
        });
        reagentM.add(searchReagentMI);

        editReagentMI.setText("Editar");
        editReagentMI.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editReagentMIActionPerformed(evt);
            }
        });
        reagentM.add(editReagentMI);

        deleteReagentMI.setText("Borrar");
        deleteReagentMI.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteReagentMIActionPerformed(evt);
            }
        });
        reagentM.add(deleteReagentMI);

        searchAllReagentMI.setText("Listar");
        reagentM.add(searchAllReagentMI);

        jMenuBar1.add(reagentM);

        orderM.setText("Ordenes");

        createOrderMI.setText("Crear");
        orderM.add(createOrderMI);

        searchOrderMI.setText("Buscar");
        orderM.add(searchOrderMI);

        editOrderMI.setText("Editar");
        orderM.add(editOrderMI);

        deleteOrderMI.setText("Borrar");
        orderM.add(deleteOrderMI);

        searchAllOrderMI.setText("Listar ");
        orderM.add(searchAllOrderMI);

        jMenuBar1.add(orderM);

        aboutM.setText("Acerca de");

        aboutMI.setText("Acerca");
        aboutMI.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aboutMIActionPerformed(evt);
            }
        });
        aboutM.add(aboutMI);

        jMenuBar1.add(aboutM);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(MainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(MainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void aboutMIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aboutMIActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_aboutMIActionPerformed

    private void createReagentMIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createReagentMIActionPerformed
        createReagentPanel = new CreateReagentPanel();
        MainPanel.setVisible(false);
        MainPanel.removeAll();
        MainPanel.add(createReagentPanel);
        MainPanel.setVisible(true);
    }//GEN-LAST:event_createReagentMIActionPerformed

    private void startMIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startMIActionPerformed
        MainPanel.setVisible(false);
        MainPanel.removeAll();
        MainPanel.setVisible(true);
    }//GEN-LAST:event_startMIActionPerformed

    private void exitMIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMIActionPerformed
        System.exit(0);
    }//GEN-LAST:event_exitMIActionPerformed

    private void editReagentMIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editReagentMIActionPerformed
        editReagentPanel = new EditReagentPanel();
        MainPanel.setVisible(false);
        MainPanel.removeAll();
        MainPanel.add(editReagentPanel);
        MainPanel.setVisible(true);
    }//GEN-LAST:event_editReagentMIActionPerformed

    private void searchReagentMIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchReagentMIActionPerformed
        searchReagentPanel = new SearchReagentPanel();
        MainPanel.setVisible(false);
        MainPanel.removeAll();
        MainPanel.add(searchReagentPanel);
        MainPanel.setVisible(true);
    }//GEN-LAST:event_searchReagentMIActionPerformed

    private void deleteReagentMIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteReagentMIActionPerformed
        deleteReagentPanel = new DeleteReagentPanel();
        MainPanel.setVisible(false);
        MainPanel.removeAll();
        MainPanel.add(deleteReagentPanel);
        MainPanel.setVisible(true);
    }//GEN-LAST:event_deleteReagentMIActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        MainFrame mainFrame = new MainFrame();
        mainFrame.setVisible(false);
        mainFrame.setLocationRelativeTo(null);
        mainFrame.setVisible(true);
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel MainPanel;
    private javax.swing.JMenu aboutM;
    private javax.swing.JMenuItem aboutMI;
    private javax.swing.JMenuItem createOrderMI;
    private javax.swing.JMenuItem createReagentMI;
    private javax.swing.JMenuItem deleteOrderMI;
    private javax.swing.JMenuItem deleteReagentMI;
    private javax.swing.JMenuItem editOrderMI;
    private javax.swing.JMenuItem editReagentMI;
    private javax.swing.JMenuItem exitMI;
    private javax.swing.JMenu fileM;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenu orderM;
    private javax.swing.JMenu reagentM;
    private javax.swing.JMenuItem searchAllOrderMI;
    private javax.swing.JMenuItem searchAllReagentMI;
    private javax.swing.JMenuItem searchOrderMI;
    private javax.swing.JMenuItem searchReagentMI;
    private javax.swing.JMenuItem startMI;
    // End of variables declaration//GEN-END:variables
}
